import axios from '@/api/fetch';
//import * as types from './types';
import SERVER from '@/api/server';

//索赔审核原因维护-主机厂

//索赔审核原因维护-主页面查询
export const getListByPage = params => axios.get(`${SERVER.CLAIMFAC}/const/getRoList`,  {params} );

//新增的保存
export const newSave = params => axios.post(`${SERVER.CLAIMFAC}/rPCmsClaim/saveOne`,  params );
//批量启动
export const piliangqiyong = data => axios.post(`${SERVER.CLAIMFAC}/rPCheckReason/updateEnableByIds`,  null ,{params : data} );
//批量停用
export const piliangtingyong = data => axios.post(`${SERVER.CLAIMFAC}/rPCheckReason/updateEnableByIds`,  null ,{params : data} );

//一般车辆配件类型保修期编辑弹窗的保存
export const editSave = params => axios.post(`${SERVER.CLAIMFAC}/rPCmsClaim/updateByPtId`,  params );
//审核
export const approve = params => axios.post(`${SERVER.CLAIMFAC}/rPCmsClaim/approveById`,  params );
//通过ID查
export const quySP = params => axios.get(`${SERVER.CLAIMFAC}/rPCmsClaim/selectById/${params.id}`);

//导出模版
export const downloadModel = params => {
  const url = `${SERVER.CLAIMFAC}/rPCheckReason/exportModel`;
  return axios({
    url,
    method: 'post',
    responseType: 'blob'
  });
};
//导出
export const getListForExport = (params) => axios.post(`${SERVER.CLAIMFAC}/rPCmsClaim/getListForExport`, params, {
  responseType: 'blob'
});
export const getSupplierList = (params) => axios.get(`${SERVER.CLAIMFAC}/const/getSupplierList`, {params});
export const getListByPageWork = params => axios.get(`${SERVER.CLAIMFAC}/const/getRoList`,  {params} );
export const getPartList = params => axios.get(`${SERVER.CLAIMFAC}/const/getPartList`,  {params} );
export const getListByGz = params => axios.post(`${SERVER.CLAIMFAC}/rPFaultAppear/getListByPage`,  params );
export const getListByYsq = params => axios.post(`${SERVER.CLAIMFAC}/rPPreAuth/getListByPage`,  params );
export const getListByReason = params => axios.post(`${SERVER.CLAIMFAC}/rPFaultReason/getListByPage`,  params );
export const getHelpList = params => axios.get(`${SERVER.CLAIMFAC}/const/getHelpList`,  {params} );
export const getSelfList = params => axios.get(`${SERVER.CLAIMFAC}/const/getSelfList`,  {params} );
export const getLabourList = params => axios.get(`${SERVER.CLAIMFAC}/const/getLabourList`,  {params} );
export const getListrpPart = params => axios.post(`${SERVER.CLAIMFAC}/rpPart/getListByPage`,  params );
export const getAddList = params => axios.get(`${SERVER.CLAIMFAC}/const/getAddList`,  {params} );
export const getRoLogList = params => axios.get(`${SERVER.CLAIMFAC}/const/getRoLogList`,  {params} );
export const getSpList = params => axios.post(`${SERVER.CLAIMFAC}/rPCmsClaim/getListByPage`,  params );
export const getRoById = params => axios.get(`${SERVER.CLAIMFAC}/const/getRoById`,  {params} );
export const getBgList = params => axios.post(`${SERVER.CLAIMFAC}/rpCmsClaimChange/getListByPage`,  params );
export const getShList = params => axios.post(`${SERVER.CLAIMFAC}/rPCmsClaimLog/getListByPage`,  params );
export const zuofeiFun = params => axios.post(`${SERVER.CLAIMFAC}/rPCmsClaim/updateStatusByClaimId/${params.id}`,  params );









